﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ueEngine.Biz.Inf.LogicEntity.SupportData;
using ueEngine.Biz.Inf.Entities;

namespace ueEngine.Biz.Inf.LogicEntity
{
    public class FeedbackModel : IAccessible<Feedback, FeedbackModel>
    {
        #region self
        public int Id { get; set; }
        public string User { get; set; }
        public DateTime WriteDate { get; set; }
        public FeedbackType FeedbackType { get; set; }
        public string ReferenceUri { get; set; }
        public string Message { get; set; }
        public bool IsProcess { get; set; }
        public string Admin { get; set; }
        #endregion

        protected override void Covariant(Feedback dbModel)
        {
            this.Admin = dbModel.Admin;
            this.FeedbackType = (LogicEntity.FeedbackType)dbModel.FeedbackType;
            this.Id = dbModel.Id;
            this.IsProcess = dbModel.IsProcess;
            this.Message = dbModel.Message;
            this.ReferenceUri = dbModel.ReferenceUri;
            this.User = dbModel.User;
            this.WriteDate = dbModel.WriteDate;
        }
        protected override Feedback Inverter(FeedbackModel model)
        {
            return new Feedback()
            {
                Admin = model.Admin,
                FeedbackType = (int)model.FeedbackType,
                Id = model.Id,
                IsProcess = model.IsProcess,
                Message = model.Message,
                ReferenceUri = model.ReferenceUri,
                User = model.User,
                WriteDate = model.WriteDate
            };
        }
    }
}
